/**
 * Created by Administrator on 2017/3/25.
 */
/*var Text = React.createClass({
    render:function () {
        return <div>i love {this.props.name}</div>;
    }
});

ReactDOM.render(<Text name="mm"/>, document.body);*/


var Text = React.createClass({
    render:function () {
        return <div>i love {this.props.name}</div>;
    }
});

var Parent = React.createClass({
    getInitialState :function(){
      return {username:"lisi"};
    },
    inputChange:function (e) {
        this.setState({username:e.target.value})
    },
    render :function () {
        return <div>
            <Text name={this.state.username}></Text>
            <input type="text" onChange={this.inputChange} ></input>
        </div>
    }
});

ReactDOM.render(<Parent></Parent>, document.body);